package com.itheima.task2;

public class Test {
    public static void main(String[] args) {
        NewPhone np = new NewPhone();
        usePhone(np);

        OldPhone op = new OldPhone();
        usePhone(op);
    }

    public static void usePhone(Phone p){
        p.call();
        p.sendMessage();
        if(p instanceof NewPhone np){
            np.playGame();
        }
    }
}
